//
//  CEISliderPlot.h
//  Balance
//
//  Created by Calvin Kuo on 12-05-14.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

/*
 Status: changed
 Last Merge Date: 05-29-2012
 Last Change Date: 
 Changes:
 1. 
 */

#import <Foundation/Foundation.h>
#import "CorePlot-CocoaTouch.h"
#import "CEIData.h"

@protocol CEISliderPlotDelegate;

@interface CEISliderPlot : NSObject<CPTPlotDataSource,CPTPlotSpaceDelegate, CPTScatterPlotDataSource>
{
@private
    CPTGraph *graph;
    CPTScatterPlot *sliderPlot;
    CPTScatterPlot *fromIndicatorPlot; //date range selector: from-date
    CPTScatterPlot *toIndicatorPlot;  //date range selector: to-date
    CPTRangePlot *rangePlot;
    NSMutableDictionary *dailyCEI;
    NSArray *dailyKeys;
    NSUInteger totalNoOfDataPoints;
    NSArray * monthlyKeys;
    //NSInteger distanceToIndicator;
    NSString *direction;
    NSInteger previousXPoint;
    //NSInteger previousFromCoordination;
    //NSInteger previousToCoordination;
    NSInteger fromIndex;
    NSInteger toIndex;
    NSInteger previousFromIndex;
    NSInteger previousToIndex;
    NSInteger selectedCoordination;
    NSInteger numberOfPeriods;
    BOOL fromIndicatorPlotSelected, toIndicatorPlotSelected;
    BOOL rangePlotMoved;
    NSDate *startDate;
    CEIData *startDateData;
    CEIData *endDateData;
    //NSString *startDateString;
    
  

}

@property (nonatomic, retain) id<CEISliderPlotDelegate> delegate;

- (id) initWithOneCollectorData:(NSMutableDictionary *) ceiData monthlyData:(NSArray *)monthlyData;
- (void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme;
- (void)applyIndicatorPlotColor;    
- (void)highlightPlotColor:(CPTScatterPlot *)plot;
    

@end

// Delegate to notify the view controller that the location of the line has changed.
@protocol CEISliderPlotDelegate <NSObject> 
@optional

- (void)sliderPlot:(CEISliderPlot *)plot fromDate:(NSString *)fromDateString toDate:(NSString *)toDateString;

@end